"""Sams URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import re_path as url
from Sams import views
from student import views as student_views
from Record import views as record_views
from academy import views as academy_views
from detail import chart
from detail import views as detail_views
from detail import pandas


urlpatterns = [
    path('admin/', admin.site.urls),
    # 默认访问首页
    url(r'^$',views.index),
    # 首页
    url('index/',views.index,name='index'),

    # 学生登录
    url('studentLogin/',student_views.studentLogin,name='studentLogin'),
    # 我的成绩
    url('grade/',record_views.grade),
    # 学生登出
    path('stulogout/',student_views.stuLogout,name='stuLogut'),
    # 学生信息
    path('userfile/',student_views.userfile,name='userfile'),
    # 学生注册
    path('studentRegister/',student_views.studentRegister,name='studentRegister'),

    # 数据统计
    path('chart/',chart.chart_list),
    # 柱状图，可以从后端修改数据
    path('chart/bar/',chart.chart_bar),
    # 折线图,可以从后端修改数据
    path('chart/line/',chart.chart_line),

    # 学生详情界面
    path('gradeDetail/',detail_views.detailList ,name='gradeDetail'),
    # 添加学生功能
    path('addStudent/',detail_views.student_add,name='addStudent'),
    # 学生详情界面编辑
    path('gradeDetail/<int:nid>/edit',detail_views.student_edit),
    # 学生详情界面删除
    path('gradeDetail/<int:nid>/delete',detail_views.student_delete),
    # 随机从数据库里面生成名字
    path('randomName/', detail_views.randomName),
    # 排序功能
    path('sort/',detail_views.sort),
    # 下载excel文件
    path('download/',detail_views.download),
    # 成绩列表图
    path('dbschart/',detail_views.dbschart),
    # pandas 计算
    path('pandas/',pandas.readFile),
    # 下载文件
    path('download/calufile/',pandas.download),

]
